<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./jquery.min.js"></script>
    <style>
        div {
            width: 300px;
            height: 300px;
            background-color: skyblue;
        }

        button {
            width: 100px;
            height: 30px;
        }

        .orange {
            background-color: orange;
        }
        .orange1 {
            background-color: orange;
        }
    </style>
</head>

<body>
    <button>切换css变红</button>
    <button>切换class变橙</button>
    <div>牡丹虽好空入目，枣花最小结实诚</div>
    <script>
        //点击切换红色
        $('button:first').click(function() {
            $('div').css('background', 'red')
        })
        //先去掉红色的行内样式，然后变橙
        $('button:last').click(function() {
            $('div').css('background', '').addClass('orange')
        })
    </script>
</body>

</html>